<pre class="docs-method-signature"><code>path.getSegment(index)</code></pre>
<p>Return the path segment at <code>index</code>.</p>

<p>Negative indices are accepted; they instruct the algorithm to start looking from the end of the segments array.</p>

<p>Throws an error if the path has no segments. Also throws an error if the index is out of range.</p>
